
class Date{
    public int year;
    public int month;
    public int day;
    public Date(){
       //this.year =2008;
        this(2025,3,18);
        System.out.println("这个是不带参数的构造方法");
    }
    public Date(int year,int month,int day){
        this.year =year;
        this.month =month;
        this.day = day;
        System.out.println("这个是调用了带有3个参数的构造方法");
    }
    //写一个方法 来设置 年月日
    public void setDate(int year,int month,int day) {
        this.year = year;
        this.month =month;
        this.day = day;
    }
    public void printDate(){
        System.out.println(this.year +"年 "+this.month+"月 "+this.day+"日 ");
    }

    public static void main(String[] args) {
       //System.out.println(this.year);
        Date date =new Date();
        date.setDate(2025,3,18);
        date.printDate();
        Date date2 =new Date();
        date2.setDate(2024,8,13);
        date2.printDate();
        Date date3 =new Date();
        date3.setDate(2005,10,9);
        date3.printDate();
    }
}

